<?php
namespace Application\pform\a_wan;

use Application\model\BaseLoginModel;
use Cola\Model;

class PublicModel extends Model
{

    public static function signV21($params,$salt,$noKey=[]){

        ksort($params);
        $signStr = [];
        foreach ($params as $key => $val) {
            if(in_array($key,$noKey)){
                continue;
            }

            $signStr[] = $key . '=' . $val;

        }

        $before = implode('&', $signStr).$salt;
        return [$before,strtolower(md5($before))];
    }


    public static function signV22($params, $salt,$noKey=[]){
        ksort($params);
        $signStr = [];
        foreach ($params as $key => $val) {
            if(in_array($key,$noKey)){
                continue;
            }
            $signStr[] = $key . '=' . $val;
        }
        $before = $salt.implode('&', $signStr);
        return [$before,strtolower(md5($before))];
    }



}
